package hczc.longcai.com.hccrowdfunding.asynctask;

import android.content.Context;
import android.os.AsyncTask;
import android.telecom.Call;
import android.util.Log;

import java.util.List;

import hczc.longcai.com.hccrowdfunding.application.BaseApplication;
import hczc.longcai.com.hccrowdfunding.home.fourth_mine.beans.Address;

/**
 * 读取Address的数据库的异步任务
 * Created by Administrator on 2016/2/3.
 */
public class AddressAsyncTask extends AsyncTask<Void,Void,List<Address>> {

    private static final String TAG = "AddressAsynsTask";
    private CallBack callBack;

    public AddressAsyncTask(CallBack callBack) {
        this.callBack = callBack;
    }

    @Override
    protected List<Address> doInBackground(Void... params) {
        List<Address> address = BaseApplication.dbAddressController.getAddress();
        return address;
    }

    @Override
    protected void onPostExecute(List<Address> addresses) {
        super.onPostExecute(addresses);
        callBack.response(addresses);
    }
    public interface CallBack{
        void response(List<Address> list);
    }
}
